package $2_1oo;

public class ConstructorFunction {

	public static void main(String[] args) {
		// 构造方法 Constructor 
		// 创建实例的时候，实际上是通过构造方法来初始化实例的。
		Persond p = new Persond("Xiao Ming", 15);
        System.out.println(p.getName());
        System.out.println(p.getAge());

	}

}

class Persond {
    private String name;
    private int age;

    public Persond(String name, int age) {
        this.name = name;
        this.age = age;
    }
    
    public String getName() {
        return this.name;
    }

    public int getAge() {
        return this.age;
    }
}